<template>
  <div class="navList">
    <van-grid :column-num="4" :border="false" :clickable="true">
      <van-grid-item
        v-for="item in navList"
        :key="item.title"
        :icon="item.imgSrc"
        :text="item.title"
      />
    </van-grid>
  </div>
</template>

<script>
import { getNavList } from "@/api";
import { Grid, GridItem } from "vant";

export default {
  name: "NavList",
  async mounted() {
    // 请求数据
    let res = await getNavList();
    this.navList = res.result;
  },
  data() {
    return {
      navList: null,
    };
  },
  components: {
    "van-grid-item": GridItem,
    "van-grid": Grid,
  },
};
</script>

<style scoped></style>
